﻿// ===============================================================================
// TableSchemaCollection.cs
// EOS Framework
// ===============================================================================
// Copyright (c) EOS Development Group. All rights reserved.
// ===============================================================================

namespace EOS.Framework.Contracts.Schema
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;

    /// <summary>
    /// Represents a not writeable list of <see cref="TableSchema"/> objects.
    /// </summary>
    [Serializable]
    public class TableSchemaCollection : KeyedCollection<string, TableSchema>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TableSchemaColzlection"/> class.
        /// </summary>
        public TableSchemaCollection()
        {
        }

        /// <summary>
        /// Extracts the key from the specified element.
        /// </summary>
        /// <param name="item">The element from which to extract the key.</param>
        /// <returns>The key for the specified element.</returns>
        protected override string GetKeyForItem(TableSchema item)
        {
            return item.Name;
        }
    }
}
